package com.ruoyi.ai.enums;

import lombok.Getter;

import java.util.Arrays;

/**
 * 聊天状态枚举
 */
public enum AiChatStatusEnum {
    /**
     * 聊天状态枚举
     */
    NORMAL(0, "正常"),
    ERROR(1, "报错"),
    ;

    @Getter
    private final Integer type;
    @Getter
    private final String desc;

    AiChatStatusEnum(Integer type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public static AiChatStatusEnum getByType(Integer type) {
        return Arrays.stream(values()).filter(c -> c.getType().equals(type)).findFirst().orElse(null);
    }
}
